/* 
用于登录验证码
*/

import CryptoJS from "crypto-js";

const md5 = (str) => CryptoJS.MD5(str).toString().toUpperCase(),
  date = new Date(),
  dateStr = `${date.getFullYear()}-${
    date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1
  }-${date.getDate() < 10 ? "0" + date.getDate() : date.getDate()}`;

let md5code = md5(dateStr).slice(10, 20); // 加盐
export default md5code;

export { dateStr, md5 };
